The present invention generally relates to automated testing of computer software systems. More specifically, embodiments of the present invention pertain to reusable and customizable software, frameworks, and systems for automated testing.
In computer programming, unit testing is a method by which individual units of source code are tested to determine if they are fit for use. A “unit” is conventionally the smallest testable part of an application. In procedural programming a unit may be an individual function or procedure. Ideally, each test case is independent from the others: substitutes like method stubs, mock, objects, fakes and test harnesses can be used to assist testing a module in isolation. Unit tests are typically written and run by software developers to ensure that code meets its design and behaves as intended. Its implementation can vary from being very manual (pencil and paper) to being formalized as part of build automation.
The goal of unit testing is to isolate each part of the program and show that the individual parts are correct. A unit test provides a strict, written contract that the piece of code must satisfy. As a result, it affords several benefits. Unit tests find problems early in the development cycle. The procedure is to write test cases for all functions and methods so that whenever a change causes a fault, it can be quickly identified and fixed. Readily-available unit tests make it easy for the programmer to check whether a piece of code is still working properly.
Test-driven development (TDD) is a software development process that relies on the repetition of a very short development cycle: first the developer writes a failing automated test case that defines a desired improvement or new function, then produces code to pass that test and finally refactors the new code to acceptable standards. The tests contain assertions that are either true or false. Passing the tests confirms correct behavior as developers evolve and refactor the code. Developers often use testing frameworks, such as JUnit for Java-based software, NUnit for Microsoft .Net-based software, to create and automatically run sets of test cases. Various automated testing frameworks have come to be known collectively as xUnit. These frameworks allow testing of different units of software, such as functions and classes. The main advantage of xUnit frameworks is that they provide an automated solution with no need to write the same tests many times, and no need to remember what should be the result of each test.
Most of the legacy features in a test-driven development organization are accompanied by an extensive suite of comprehensive tests validating and verifying their behavior. The automated tests validate and verify the behavior of the system as it is developed. In addition, existing tests provide valuable regression coverage to ensure that extensions, bug fixes, and other modifications do not break existing functionality. However, many existing tests may be applicable to new features and new configurations, so a framework to support reuse and extensibility of automated test procedures for a variety of configurations is desirable.